package com.project.livetv.activity;

import android.graphics.Color;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Layout;
import android.view.MotionEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.project.livetv.R;

import java.util.ArrayList;
import java.util.List;

public class UserShowActivity extends AppCompatActivity {
     private LinearLayout female_layout,male_layout,all_layout;
    ImageView all_image,all_image_heart,female_image,female_image_heart,male_image,male_image_heart;
    private TextView female_text,male_text,all_text;
    List<LinearLayout> list;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_show);
        initView();
        initData();
        setData();

    }

    private void setData() {
        female_layout.setSelected(true);
    }

    private void initData() {
        list=new ArrayList<>();
        list.add(female_layout);
        list.add(all_layout);
        list.add(male_layout);
//        all_layout.setOnTouchListener(new View.OnTouchListener() {
//            @Override
//            public boolean onTouch(View v, MotionEvent event) {
//                all_image.setSelected(true);
//                all_image_heart.setSelected(true);
//                return true;
//            }
//        });
//        all_layout.setOnClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//
//                Toast.makeText(UserShowActivity.this, "kkkkkkkkkk", Toast.LENGTH_SHORT).show();
//            }
//        });
  }

    private void initView() {
        female_layout= (LinearLayout) findViewById(R.id.female);
        male_layout= (LinearLayout) findViewById(R.id.male);
        all_layout= (LinearLayout) findViewById(R.id.all);
        all_image= (ImageView) findViewById(R.id.all_user_text);
        all_image_heart= (ImageView) findViewById(R.id.all_user_imageview);
        //female_image,female_image_heart,male_image,male_image_heart;
        //private TextView female_text,male_text,all_text;
        female_image= (ImageView) findViewById(R.id.user_female_choice);
        female_image_heart= (ImageView) findViewById(R.id.user_female_heart_choice);
        male_image= (ImageView) findViewById(R.id.user_male_choice);
        male_image_heart= (ImageView) findViewById(R.id.user_male_heart_choice);
        female_text= (TextView) findViewById(R.id.user_female_textView);
        male_text= (TextView) findViewById(R.id.user_male_textView);
        all_text= (TextView) findViewById(R.id.user_all_textView);
    }
public void onClick(View view){
    switch (view.getId()){
        case R.id.all:
            all_image.setSelected(true);
            all_image_heart.setSelected(true);
            all_text.setTextColor(Color.parseColor("#8EE2D3"));


            female_text.setTextColor(Color.GRAY);
            female_image_heart.setSelected(false);
            female_image.setSelected(false);

            male_image_heart.setSelected(false);
            male_image.setSelected(false);
            male_text.setTextColor(Color.GRAY);
            break;
        case R.id.female:
            female_text.setTextColor(Color.parseColor("#FF99CC"));
            female_image_heart.setSelected(true);
            female_image.setSelected(true);

            all_image.setSelected(false);
            all_image_heart.setSelected(false);
            all_text.setTextColor(Color.GRAY);

            male_image_heart.setSelected(false);
            male_image.setSelected(false);
            male_text.setTextColor(Color.GRAY);
            break;
        case R.id.male:
            male_image_heart.setSelected(true);
            male_image.setSelected(true);
            male_text.setTextColor(Color.parseColor("#99CCFF"));

            all_image.setSelected(false);
            all_image_heart.setSelected(false);
            all_text.setTextColor(Color.GRAY);

            female_text.setTextColor(Color.GRAY);
            female_image_heart.setSelected(false);
            female_image.setSelected(false);
            break;

   }
}



}
